class DdtDetailModel {
	String type;
	String code;
	String message;
	String favTotal;
	FlashSaleProductInfo flashSaleProductInfo;
	FlashSaleProductInfo mixologisticsInformationInfo;
	String pdpVideoUrl;
	ProductDetail productDetail;
	String saleName;
	String salesTerminology;
	String salesTotal;
	DdtDetailModel({this.type, this.code, this.message, this.favTotal, this.flashSaleProductInfo, this.mixologisticsInformationInfo, this.pdpVideoUrl, this.productDetail, this.saleName, this.salesTerminology, this.salesTotal});

	DdtDetailModel.fromJson(Map<String, dynamic> json) {
		type = json['type'];
		code = json['code'];
		message = json['message'];
		favTotal = json['favTotal'];
		flashSaleProductInfo = json['flashSaleProductInfo'] != null ? new FlashSaleProductInfo.fromJson(json['flashSaleProductInfo']) : null;
		mixologisticsInformationInfo = json['mixologisticsInformationInfo'] != null ? new FlashSaleProductInfo.fromJson(json['mixologisticsInformationInfo']) : null;
		pdpVideoUrl = json['pdpVideoUrl'];
		productDetail = json['productDetail'] != null ? new ProductDetail.fromJson(json['productDetail']) : null;
		saleName = json['saleName'];
		salesTerminology = json['salesTerminology'];
		salesTotal = json['salesTotal'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['type'] = this.type;
		data['code'] = this.code;
		data['message'] = this.message;
		data['favTotal'] = this.favTotal;
		if (this.flashSaleProductInfo != null) {
      data['flashSaleProductInfo'] = this.flashSaleProductInfo.toJson();
    }
		if (this.mixologisticsInformationInfo != null) {
      data['mixologisticsInformationInfo'] = this.mixologisticsInformationInfo.toJson();
    }
		data['pdpVideoUrl'] = this.pdpVideoUrl;
		if (this.productDetail != null) {
      data['productDetail'] = this.productDetail.toJson();
    }
		data['saleName'] = this.saleName;
		data['salesTerminology'] = this.salesTerminology;
		data['salesTotal'] = this.salesTotal;
		return data;
	}
}

class FlashSaleProductInfo {


	FlashSaleProductInfo();

	FlashSaleProductInfo.fromJson(Map<String, dynamic> json) {
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		return data;
	}
}

class ProductDetail {
	String broadTax;
	bool canPurchase;
	String categoryName;
	String code;
	String commission;
	List<Description> description;
	bool discountedProduct;
	bool discountedQuotaProduct;
	String firstLevelCategoryCode;
	bool fromMicroBuyLabel;
	List<GalleryImages> galleryImages;
	GroupPlayRule groupPlayRule;
	double groupPrice;
	Images images;
	bool isAddCart;
	bool isAlmostOutOfStock;
	bool isAmplusGift;
	bool isExactOnline;
	bool isFavourite;
	bool isGift;
	bool isGoodListShow;
	bool isMixologisticsBase;
	bool isMixologisticsProuct;
	bool isOrderable;
	bool isVariantOptions;
	List<String> labelDescription;
	String microCategoryCode;
	String month;
	String name;
	Price price;
	String salesTerminology;
	String sopLable;
	String specialActive;
	Stock stock;
	String url;
	List<VariantOptions> variantOptions;
  List<ProductAttributes> productAttributes;

	ProductDetail({this.broadTax, this.canPurchase, this.categoryName, this.code, this.commission, this.description, this.discountedProduct, this.discountedQuotaProduct, this.firstLevelCategoryCode, this.fromMicroBuyLabel, this.galleryImages, this.groupPlayRule, this.groupPrice, this.images, this.isAddCart, this.isAlmostOutOfStock, this.isAmplusGift, this.isExactOnline, this.isFavourite, this.isGift, this.isGoodListShow, this.isMixologisticsBase, this.isMixologisticsProuct, this.isOrderable, this.isVariantOptions, this.labelDescription, this.microCategoryCode, this.month, this.name, this.price, this.salesTerminology, this.sopLable, this.specialActive, this.stock, this.url, this.variantOptions});

	ProductDetail.fromJson(Map<String, dynamic> json) {
		broadTax = json['broadTax'];
		canPurchase = json['canPurchase'];
		categoryName = json['categoryName'];
		code = json['code'];
		commission = json['commission'];
		if (json['description'] != null) {
			description = new List<Description>();
			json['description'].forEach((v) { description.add(new Description.fromJson(v)); });
		}
		discountedProduct = json['discountedProduct'];
		discountedQuotaProduct = json['discountedQuotaProduct'];
		firstLevelCategoryCode = json['firstLevelCategoryCode'];
		fromMicroBuyLabel = json['fromMicroBuyLabel'];
		if (json['galleryImages'] != null) {
			galleryImages = new List<GalleryImages>();
			json['galleryImages'].forEach((v) { galleryImages.add(new GalleryImages.fromJson(v)); });
		}
		groupPlayRule = json['groupPlayRule'] != null ? new GroupPlayRule.fromJson(json['groupPlayRule']) : null;
		groupPrice = json['groupPrice'];
		images = json['images'] != null ? new Images.fromJson(json['images']) : null;
		isAddCart = json['isAddCart'];
		isAlmostOutOfStock = json['isAlmostOutOfStock'];
		isAmplusGift = json['isAmplusGift'];
		isExactOnline = json['isExactOnline'];
		isFavourite = json['isFavourite'];
		isGift = json['isGift'];
		isGoodListShow = json['isGoodListShow'];
		isMixologisticsBase = json['isMixologisticsBase'];
		isMixologisticsProuct = json['isMixologisticsProuct'];
		isOrderable = json['isOrderable'];
		isVariantOptions = json['isVariantOptions'];
		labelDescription = json['labelDescription'].cast<String>();
		microCategoryCode = json['microCategoryCode'];
		month = json['month'];
		name = json['name'];
		price = json['price'] != null ? new Price.fromJson(json['price']) : null;
		salesTerminology = json['salesTerminology'];
		sopLable = json['sopLable'];
		specialActive = json['specialActive'];
		stock = json['stock'] != null ? new Stock.fromJson(json['stock']) : null;
		url = json['url'];
		if (json['variantOptions'] != null) {
			variantOptions = new List<VariantOptions>();
			json['variantOptions'].forEach((v) { variantOptions.add(new VariantOptions.fromJson(v)); });
		}
    if (json['productAttributes'] != null) {
			productAttributes = new List<ProductAttributes>();
			json['productAttributes'].forEach((v) { productAttributes.add(new ProductAttributes.fromJson(v)); });
		}

	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['broadTax'] = this.broadTax;
		data['canPurchase'] = this.canPurchase;
		data['categoryName'] = this.categoryName;
		data['code'] = this.code;
		data['commission'] = this.commission;
		if (this.description != null) {
      data['description'] = this.description.map((v) => v.toJson()).toList();
    }
		data['discountedProduct'] = this.discountedProduct;
		data['discountedQuotaProduct'] = this.discountedQuotaProduct;
		data['firstLevelCategoryCode'] = this.firstLevelCategoryCode;
		data['fromMicroBuyLabel'] = this.fromMicroBuyLabel;
		if (this.galleryImages != null) {
      data['galleryImages'] = this.galleryImages.map((v) => v.toJson()).toList();
    }
		if (this.groupPlayRule != null) {
      data['groupPlayRule'] = this.groupPlayRule.toJson();
    }
		data['groupPrice'] = this.groupPrice;
		if (this.images != null) {
      data['images'] = this.images.toJson();
    }
		data['isAddCart'] = this.isAddCart;
		data['isAlmostOutOfStock'] = this.isAlmostOutOfStock;
		data['isAmplusGift'] = this.isAmplusGift;
		data['isExactOnline'] = this.isExactOnline;
		data['isFavourite'] = this.isFavourite;
		data['isGift'] = this.isGift;
		data['isGoodListShow'] = this.isGoodListShow;
		data['isMixologisticsBase'] = this.isMixologisticsBase;
		data['isMixologisticsProuct'] = this.isMixologisticsProuct;
		data['isOrderable'] = this.isOrderable;
		data['isVariantOptions'] = this.isVariantOptions;
		data['labelDescription'] = this.labelDescription;
		data['microCategoryCode'] = this.microCategoryCode;
		data['month'] = this.month;
		data['name'] = this.name;
		if (this.price != null) {
      data['price'] = this.price.toJson();
    }
		data['salesTerminology'] = this.salesTerminology;
		data['sopLable'] = this.sopLable;
		data['specialActive'] = this.specialActive;
		if (this.stock != null) {
      data['stock'] = this.stock.toJson();
    }
		data['url'] = this.url;
		if (this.variantOptions != null) {
      data['variantOptions'] = this.variantOptions.map((v) => v.toJson()).toList();
    }
		return data;
	}
}

class Description {
	String detailInfo;

	Description({this.detailInfo});

	Description.fromJson(Map<String, dynamic> json) {
		detailInfo = json['detailInfo'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['detailInfo'] = this.detailInfo;
		return data;
	}
}

class GalleryImages {
	String middelImg;
	String smallImg;
	String zoomImg;

	GalleryImages({this.middelImg, this.smallImg, this.zoomImg});

	GalleryImages.fromJson(Map<String, dynamic> json) {
		middelImg = json['middelImg'];
		smallImg = json['smallImg'];
		zoomImg = json['zoomImg'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['middelImg'] = this.middelImg;
		data['smallImg'] = this.smallImg;
		data['zoomImg'] = this.zoomImg;
		return data;
	}
}

class GroupPlayRule {
	List<String> entryList;
	String name;
	String rule;

	GroupPlayRule({this.entryList, this.name, this.rule});

	GroupPlayRule.fromJson(Map<String, dynamic> json) {
		entryList = json['entryList'].cast<String>();
		name = json['name'];
		rule = json['rule'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['entryList'] = this.entryList;
		data['name'] = this.name;
		data['rule'] = this.rule;
		return data;
	}
}

class Images {
	String icon;
	String url;

	Images({this.icon, this.url});

	Images.fromJson(Map<String, dynamic> json) {
		icon = json['icon'];
		url = json['url'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['icon'] = this.icon;
		data['url'] = this.url;
		return data;
	}
}

class Price {
	AmwayValue amwayValue;
	int giftPoint;
	int maxQuantity;
	int minQuantity;
	String priceRange;
	String value;

	Price({this.amwayValue, this.giftPoint, this.maxQuantity, this.minQuantity, this.priceRange, this.value});

	Price.fromJson(Map<String, dynamic> json) {
		amwayValue = json['amwayValue'] != null ? new AmwayValue.fromJson(json['amwayValue']) : null;
		giftPoint = json['giftPoint'];
		maxQuantity = json['maxQuantity'];
		minQuantity = json['minQuantity'];
		priceRange = json['priceRange'];
		value = json['value'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.amwayValue != null) {
      data['amwayValue'] = this.amwayValue.toJson();
    }
		data['giftPoint'] = this.giftPoint;
		data['maxQuantity'] = this.maxQuantity;
		data['minQuantity'] = this.minQuantity;
		data['priceRange'] = this.priceRange;
		data['value'] = this.value;
		return data;
	}
}

class AmwayValue {
	String businessVolume;
	String pointValue;

	AmwayValue({this.businessVolume, this.pointValue});

	AmwayValue.fromJson(Map<String, dynamic> json) {
		businessVolume = json['businessVolume'];
		pointValue = json['pointValue'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['businessVolume'] = this.businessVolume;
		data['pointValue'] = this.pointValue;
		return data;
	}
}

class Stock {
	int stockLevel;
	String stockLevelStatus;

	Stock({this.stockLevel, this.stockLevelStatus});

	Stock.fromJson(Map<String, dynamic> json) {
		stockLevel = json['stockLevel'];
		stockLevelStatus = json['stockLevelStatus'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['stockLevel'] = this.stockLevel;
		data['stockLevelStatus'] = this.stockLevelStatus;
		return data;
	}
}

class VariantOptions {
	String code;
	double groupPrice;
	Image image;
	bool isAlmostOutOfStock;
	bool isExactOnline;
	String name;
	Price price;
	Stock stock;

	VariantOptions({this.code, this.groupPrice, this.image, this.isAlmostOutOfStock, this.isExactOnline, this.name, this.price, this.stock});

	VariantOptions.fromJson(Map<String, dynamic> json) {
		code = json['code'];
		groupPrice = json['groupPrice'];
		image = json['image'] != null ? new Image.fromJson(json['image']) : null;
		isAlmostOutOfStock = json['isAlmostOutOfStock'];
		isExactOnline = json['isExactOnline'];
		name = json['name'];
		price = json['price'] != null ? new Price.fromJson(json['price']) : null;
		stock = json['stock'] != null ? new Stock.fromJson(json['stock']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['code'] = this.code;
		data['groupPrice'] = this.groupPrice;
		if (this.image != null) {
      data['image'] = this.image.toJson();
    }
		data['isAlmostOutOfStock'] = this.isAlmostOutOfStock;
		data['isExactOnline'] = this.isExactOnline;
		data['name'] = this.name;
		if (this.price != null) {
      data['price'] = this.price.toJson();
    }
		if (this.stock != null) {
      data['stock'] = this.stock.toJson();
    }
		return data;
	}
}

class Image {
	String url;

	Image({this.url});

	Image.fromJson(Map<String, dynamic> json) {
		url = json['url'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['url'] = this.url;
		return data;
	}
}
class ProductAttributes {
  String attributeType;
  String attributeValue;
  ProductAttributes({this.attributeType,this.attributeValue});
  ProductAttributes.fromJson(Map<String, dynamic> json) {
		attributeType = json['attributeType'];
    attributeValue = json['attributeValue'];
	}
  Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['attributeType'] = this.attributeType;
    data['attributeValue'] = this.attributeValue;
		return data;
	}
}